-
Notifications
You must be signed in to change notification settings - Fork 271
IDP: avoid logging value of 'idp_client_secret' #8332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDP: avoid logging value of 'idp_client_secret' #8332
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request aims to prevent logging the sensitive idp_client_secret value. The changes introduce a specific check in dp_get_options to avoid printing the secret's value, which is a good security improvement. The PR also refactors the debug logging level for option processing to a more appropriate level and consistently uses a macro for the secret's key. However, the fix is incomplete as a similar logging vulnerability remains in another function within the same file, which could still lead to secret leakage. This critical issue needs to be addressed.
efee944 to
7dd416c
Compare
|
Hi, thank you for the patch. Have you considered to change the type of the option from bye, |
I did. |
I thought it is only about While talking about Thanks. bye, |
7dd416c to
ccbb09a
Compare
The questions is: what should be the type of this option from idp-provider/oidc_child point of view? A better solution would be introduction of a new 'DP_OPT_SENSITIVE_STRING' that would have proper d-tor and serve as a reminder "do not log me", but this would be much more invasive. As to
Done. |
ddfa1e1 to
8242fb2
Compare
|
Coverity is green. |
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively addresses a critical security vulnerability by preventing the idp_client_secret from being logged. The changes are comprehensive, covering logging during configuration loading, when reading the secret from stdin, and when including it in POST request data. The introduction of the log_string_option function is a clean way to handle sensitive configuration options, and replacing the hardcoded string "idp_client_secret" with the CONFDB_IDP_CLIENT_SECRET macro improves code maintainability. The changes appear correct and complete. Well done.
sumit-bose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
thank you for the fixes, ACK.
bye,
Sumit
Reviewed-by: Sumit Bose <sbose@redhat.com>
Note that 'ldap_default_authtok' doesn't require special handling because it is of DP_OPT_BLOB type and isn't logged. Reviewed-by: Sumit Bose <sbose@redhat.com>
as it might contain 'secret' Reviewed-by: Sumit Bose <sbose@redhat.com>
8242fb2 to
b291944
Compare
No description provided.